package com.aya.core.property.custom;

import java.beans.PropertyEditorSupport;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class CustomDatePropertyEdit extends PropertyEditorSupport {

    public CustomDatePropertyEdit() {
        super();
    }

    @Override
    public void setAsText(String text) throws IllegalArgumentException {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date parse = null;
        try {
            parse = simpleDateFormat.parse(text);
            this.setValue(parse);
        } catch (ParseException e) {
        }

    }
}
